package com.xr.miniprogram.domain.vo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xr.common.annotation.Excel;
import com.xr.miniprogram.domain.MiniProgramOrder;
import com.xr.miniprogram.domain.MiniProgramUserAddress;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 新增订单VO
 */
@Data
public class MiniProgramInsertOrderVO {

    /** 用户id */
    private Long miniProgramUserId;

    /** 服务详情id */
    private Long serviceId;

    /** 服务规格id */
    private Long serviceStandardsId;

    /** 服务封面图 */
    private String serviceCoverImg;

    /** 服务名称 */
    private String serviceName;

    /** 规格名 */
    private String standardsName;

    /** 服务次数 */
    private Long serviceNum;

    /** 总服务次数 */
    private Long serviceNumCount;

    /** 次数余量 */
    private Long serviceNumSurplus;

    /** 订单金额 */
    private BigDecimal orderPrice;

    /** 订单备注 */
    private String orderRemarks;

    //------------------------------------------其他数据----------------------------------------
    /** 服务时间(整点） */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date serviceTime;

    /** 服务地址 */
    private MiniProgramUserAddress miniProgramUserAddress;

    /** 重点区域 */
    private String cleanAreas;

    /** 服务时长 */
    private Long workTime;

    /** 服务详情版本 */
    private Long serviceVersion;

    /** 规格版本 */
    private Long standardsVersion;


    public MiniProgramOrder toMiniProgramOrder() {
        MiniProgramOrder order = new MiniProgramOrder();
        order.setMiniProgramUserId(miniProgramUserId);
        order.setServiceId(serviceId);
        order.setServiceStandardsId(serviceStandardsId);
        order.setServiceCoverImg(serviceCoverImg);
        order.setServiceName(serviceName);
        order.setStandardsName(standardsName);
        order.setServiceNum(serviceNum);
        order.setServiceNumCount(serviceNumCount);
        order.setServiceNumSurplus(serviceNumSurplus);
        order.setOrderPrice(orderPrice);
        order.setOrderRemarks(orderRemarks);
        return order;
    }
}
